Variations

In this lesson, we'll look at some variations and experiments that can be done on the approaches discussed in the previous lesson.

Instead of Atom, a different format can be used for the communication of changes via HTTP.

Rich site summary#

Atom is just one format for feeds. An alternative is RSS.

  • There are different versions of RSS.
  • RSS is older than Atom.
  • Atom has learned from RSS and represents the more modern alternative.
  • Blogs and podcasts should offer feeds as RSS and Atom to reach as many clients as possible.

Because server and client are under the control of the same developer in case of microservices, it is not necessary to support multiple protocols.

Therefore, Atom is a better and more modern alternative.

JSON feed#

Another alternative is JSON Feed as it defines a data format for a feed.

However, it uses JSON rather than XML, which is used by Atom and RSS.

Custom data format#

Atom and RSS are only formats for communicating changes. Some of the elements are not useful for data, but only for blogs or podcasts. The useful part of Atom and RSS is the list of changes and the links to the actual data. Atom and RSS, therefore, use hypermedia to communicate the changes without delivering all data.

Of course, it’s feasible to define your own data format, which contains the changes and links to the data. In addition to the links, the data can be embedded directly into the document.

Disadvantages#

Compared to Atom and RSS, a custom data format has the disadvantage in that it is not standardized.

  • For a standardized data model, libraries are available.
  • Learning about the format is easier.
  • There are tools such as validators in which a user can read and display Atom data with an Atom reader, which is useful for troubleshooting.

However, the data to be transported is not very complex, and so a custom data format has no major disadvantages.

In essence, even with Atom, the approach simply uses hypermedia as an essential component of REST. It provides a list of links that clients can use to get more information about the changes to the data. This procedure can also be easily implemented with a custom data format.

Alternatives to HTTP#

HTTP supports features such as scaling or reliability very well. Most applications already use HTTP without Atom to deliver web pages or provide REST services.

The alternative to HTTP would be a messaging system such as Kafka (see chapter 7), which can also be used to implement asynchronous communication.

  • These messaging systems must be scalable and have to provide high availability.
  • The messaging systems offer these features in principle but must be tuned and configured accordingly.
  • This is especially challenging if you have never operated such a messaging system before.
  • In particular, the advantages of HTTP concerning operation argue for using this protocol also for asynchronous communication.

Including event data#

Of course, the feed can also include the event data rather than just links.

  • In this way, a client can work with the data without further requests to load the linked data; but the feed gets bigger.
  • The question also arises as to what data should be included in the feed. Each client may need different data, which makes it difficult to model the data.
  • Sending links has the advantage that the client can select the appropriate representation of the data with content negotiation.

                                                 Q U I Z  

1

Why is Atom better than RSS?

A)

Atom is newer and has learned from RSS.

B)

RSS is only used with blogs.

C)

Atom supports podcasts.

Question 1 of 20 attempted

We’ll look at a few experiments you could try out in the next lesson.

Example
Experiments
Mark as Completed
Report an Issue